<?xml version="1.0" encoding="UTF-8" ?>
<%@page import="com.baoyanghui.common.Constants"%>
<%@page import="com.baoyanghui.model.CarInfo"%>
<%@page import="com.baoyanghui.model.MerchantType"%>
<%@page import="java.lang.reflect.Field"%>
<%@page import="net.sf.json.JSONArray"%>
<%@page import="com.baoyanghui.model.ResultObject"%>
<%@page import="com.baoyanghui.common.DataChanger"%>
<%@page import="com.baoyanghui.common.InterfaceAccess"%>
<%@page import="java.util.Map"%>
<%@page import="java.util.HashMap"%>
<%@page import="java.util.List"%>
<%@page import="com.baoyanghui.model.MerchantPlace"%>
<%@page import="com.baoyanghui.model.Merchant"%>
<%@page import="net.sf.json.JSONObject"%>
<%@page import="com.baoyanghui.config.Configs"%>
<%@page import="com.baoyanghui.common.Utils"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<% 
	if (Utils.empty((String)request.getSession().getAttribute(Configs.SESSION_USER_ID))
			|| (Constants.USER_TYPE_MERCHANT == (Integer)request.getSession().getAttribute(Configs.SESSION_USER_TYPE))) {
		response.getWriter().print("<script type='text/javascript'>\n");
		response.getWriter().print("window.location.href='" + request.getContextPath() + "/index.jsp';\n");
		response.getWriter().print("</script>\n");
		response.getWriter().flush();
		return;
	}

	String errorMessage = (String)session.getAttribute("error_message"); 
	session.removeAttribute("error_message");

	JSONObject myCars = null;
	CarInfo car = null;
	List<CarInfo> carList = null;
	Map<String, String> params = new HashMap<String, String>();
	
	try {
		request.setCharacterEncoding("UTF-8");
		
		params.put("customer_id", (String)session.getAttribute(Configs.SESSION_USER_ID));
		params.put("usercode", (String)session.getAttribute(Configs.SESSION_USERCODE));
		
		myCars = InterfaceAccess.callInterface("/customer/get_my_cars", params);
		carList = (List<CarInfo>)JSONArray.toList(myCars.getJSONArray("resultData"), CarInfo.class);
	} catch (Exception e) {
	}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link rel="stylesheet" type="text/css" href="../css/style.css"/>
		<script type="text/javascript" src="../js/jquery.js"></script>
		<script type="text/javascript" src="../js/customer_top.js"></script>
		<script type="text/javascript" src="../js/page.js"></script>
		<script type="text/javascript" src="../js/common.js"></script>
		<script type="text/javascript">saveWSContextPath('<%= request.getContextPath() %>', '<%= InterfaceAccess.InterfaceContext %>');</script>
		<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language=zh-CN"></script>
		<script type="text/javascript" src="<%= request.getContextPath() %>/js/infoWindow.js"></script>
		<script type="text/javascript" src="<%= request.getContextPath() %>/js/my_account.js"></script>
		<title>宝养汇</title>
	</head>
	<body onload="saveWSContextPath('<%= request.getContextPath() %>', '<%= InterfaceAccess.InterfaceContext %>');"
		style="background: url('<%= request.getContextPath() %>/image/bg_customer_main.png');">
		<jsp:include page="../common/header.jsp"></jsp:include>
		<div style="width: 1000px; padding-top: 10px; padding-left: 20px;">
			<img class="pointer fade_effect" src="<%= request.getContextPath() %>/image/btn_personal_setting.png" 
				style="float: left;" onclick="showMySettingTab();"/>
			<img class="pointer fade_effect" src="<%= request.getContextPath() %>/image/btn_my_maintain.png" 
				style="margin-left: 20px; float: left;" onclick="showMyMaintainTab();"/>
			<img class="pointer fade_effect" src="<%= request.getContextPath() %>/image/btn_my_need.png" 
				style="margin-left: 20px; float: left;" onclick="showMyRequestTab();"/>
			<img class="pointer fade_effect" src="<%= request.getContextPath() %>/image/btn_my_comment.png" 
				style="margin-left: 20px; float: left;" onclick="showMyCommentTab();"/>
			<img class="pointer fade_effect" src="<%= request.getContextPath() %>/image/btn_my_favorite.png" 
				style="margin-left: 20px; float: left;"/>
			<img class="pointer fade_effect" src="<%= request.getContextPath() %>/image/btn_my_message.png" 
				style="margin-left: 20px; float: left;"  onclick="showMyMessageTab();"/>
			<div style="clear: both;"></div>
		</div>
		<div style="min-width: 1000px; height: 9px; margin-top: 10px; background: url('<%= request.getContextPath() %>/image/border_near_top.png');"></div>
		<div id="div_customer_top_tabhost" align="left" style="min-width: 1000px;">
			<jsp:include page="my_setting.jsp" />
		</div>
		<jsp:include page="../common/footer.jsp" />
	</body>
</html>